package com.ruoyi.project.wechatprogram.wxuser.domain;

import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import com.ruoyi.framework.web.domain.BaseEntity;
import org.apache.shiro.crypto.SecureRandomNumberGenerator;

/**
 * 员工用户对象 wx_user
 * 
 * @author xinchen
 * @date 2020-04-12
 */
public class WxUser extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键 */
    private Integer id;

    /** 姓名 */
    @Excel(name = "姓名")
    private String name;

    /** 手机号 */
    @Excel(name = "手机号")
    private String iphone;

    /** 身份证 */
    @Excel(name = "身份证")
    private String card;

    /** 员工号 */
    @Excel(name = "员工号")
    private String number;

    /** 部门 */
    @Excel(name = "部门")
    private String department;

    /** 部门id */
    private String departmentId;

    /** 头像 */
    private String headPortrait;

    /** 地址 */
    @Excel(name = "地址")
    private String address;

    /** 用户密码 */
    private String password;

    /** 站点id */
    private Integer webId;

    /** 删除状态 */
    private Integer del;

    /** 盐加密 */
    private String salt;

    /** 账户余额 */
    private Integer balance;

    /** 预留字段4 */
    private String back4;

    public String getSalt()
    {
        return salt;
    }

    public void setSalt(String salt)
    {
        this.salt = salt;
    }

    /**
     * 生成随机盐
     */
    public void randomSalt()
    {
        // 一个Byte占两个字节，此处生成的3字节，字符串长度为6
        SecureRandomNumberGenerator secureRandom = new SecureRandomNumberGenerator();
        String hex = secureRandom.nextBytes(3).toHex();
        setSalt(hex);
    }

    public void setId(Integer id) 
    {
        this.id = id;
    }

    public Integer getId() 
    {
        return id;
    }
    public void setName(String name) 
    {
        this.name = name;
    }

    public String getName() 
    {
        return name;
    }
    public void setIphone(String iphone) 
    {
        this.iphone = iphone;
    }

    public String getIphone() 
    {
        return iphone;
    }
    public void setCard(String card) 
    {
        this.card = card;
    }

    public String getCard() 
    {
        return card;
    }
    public void setNumber(String number) 
    {
        this.number = number;
    }

    public String getNumber() 
    {
        return number;
    }
    public void setDepartment(String department) 
    {
        this.department = department;
    }

    public String getDepartment() 
    {
        return department;
    }
    public void setDepartmentId(String departmentId) 
    {
        this.departmentId = departmentId;
    }

    public String getDepartmentId() 
    {
        return departmentId;
    }
    public void setHeadPortrait(String headPortrait) 
    {
        this.headPortrait = headPortrait;
    }

    public String getHeadPortrait() 
    {
        return headPortrait;
    }
    public void setAddress(String address) 
    {
        this.address = address;
    }

    public String getAddress() 
    {
        return address;
    }

    public void setWebId(Integer webId) 
    {
        this.webId = webId;
    }

    public Integer getWebId() 
    {
        return webId;
    }
    public void setDel(Integer del) 
    {
        this.del = del;
    }

    public Integer getDel() 
    {
        return del;
    }

    public Integer getBalance() {
        return balance;
    }

    public void setBalance(Integer balance) {
        this.balance = balance;
    }

    public void setBack4(String back4)
    {
        this.back4 = back4;
    }

    public String getBack4() 
    {
        return back4;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public String toString() {
        return "WxUser{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", iphone='" + iphone + '\'' +
                ", card='" + card + '\'' +
                ", number='" + number + '\'' +
                ", department='" + department + '\'' +
                ", departmentId='" + departmentId + '\'' +
                ", headPortrait='" + headPortrait + '\'' +
                ", address='" + address + '\'' +
                ", password='" + password + '\'' +
                ", webId=" + webId +
                ", del=" + del +
                ", salt='" + salt + '\'' +
                ", balance=" + balance +
                ", back4='" + back4 + '\'' +
                '}';
    }
}
